﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using ControlExs;

namespace QXJ
{
    public partial class About : ControlExs.FormEx
    {
        public About()
        {
            InitializeComponent();
            StartPosition = FormStartPosition.CenterParent;
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.label2.Text = (new Settings1()).Version;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void About_Load(object sender, EventArgs e)
        {
            this.Left = (Screen.PrimaryScreen.WorkingArea.Width - Width) / 2;
            this.Top = (Screen.PrimaryScreen.WorkingArea.Height - Height) / 2;
        }

        #region About UI
        ///// <summary>
        ///// 绘制窗体主体部分白色透明层
        ///// </summary>
        ///// <param name="form"></param>
        ///// <param name="g"></param>
        //public static void DrawFromAlphaMainPart(Form form, Graphics g)
        //{
        //    Color[] colors = 
        //    {
        //        Color.FromArgb(5, Color.White),
        //        Color.FromArgb(30, Color.White),
        //        Color.FromArgb(145, Color.White),
        //        Color.FromArgb(150, Color.White),
        //        Color.FromArgb(30, Color.White),
        //        Color.FromArgb(5, Color.White)
        //    };

        //    float[] pos = 
        //    {
        //        0.0f,
        //        0.04f,
        //        0.10f,
        //        0.90f,
        //        0.97f,
        //        1.0f      
        //    };

        //    ColorBlend colorBlend = new ColorBlend(6);
        //    colorBlend.Colors = colors;
        //    colorBlend.Positions = pos;

        //    RectangleF destRect = new RectangleF(0, 0, form.Width, form.Height);
        //    using (LinearGradientBrush lBrush = new LinearGradientBrush(destRect, colors[0], colors[5], LinearGradientMode.Vertical))
        //    {
        //        lBrush.InterpolationColors = colorBlend;
        //        g.FillRectangle(lBrush, destRect);
        //    }
        //}
        //protected override void OnPaint(PaintEventArgs e)
        //{
        //    base.OnPaint(e);
        //   // DrawFromAlphaMainPart(this, e.Graphics);
        //}
        //protected override CreateParams CreateParams
        //{
        //    get
        //    {
        //        CreateParams cp = base.CreateParams;
        //        if (!DesignMode)
        //        {
        //            cp.ExStyle |= (int)WindowStyle.WS_CLIPCHILDREN;
        //        }
        //        return cp;
        //    }
        //}

        #endregion

        private void imageButton4_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
